// pages/recycle/recycledetail/recycledetail.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

    List: [{},
      {
        buttons3: ['空调类型', '挂机空调', '柜机空调'],
        buttons4: ['冷暖类型', '单冷型', '冷暖型'],
        buttons5: ['功率', '1匹', '1.5匹', '2匹']
      },
      {
        buttons3: ['箱门结构', '单开门', '多开门'],
        buttons4: ['最大容积', '60-120L'],
        buttons5: ['功率', '1匹', '1.5匹', '2匹']
      },
    ],

    bottombutton: false,
    data: [],
    servicename:'',

    showbuttons1: true,
    buttons1Text: '',

    showitem2: false,
    showbuttons2: true,
    buttons2Text: '',

    showitem3: false,
    showbuttons3: true,
    buttons3Text: '',

    showitem4: false,
    showbuttons4: true,
    buttons4Text: '',

    showitem5: false,
    showbuttons5: true,
    buttons5Text: '',

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {


    this.setData({
      data: this.data.List[options.serviceid],
      servicename:options.servicename
    })
    // console.log(options)
    // console.log(this.data.data)

  },


  submit() {
    wx.navigateTo({
      url: '/pages/recycle/submitform/submitform',
      events: {},
      success: res => {
        // 通过eventChannel向被打开页面传送数据
        res.eventChannel.emit('dataTosubmitform', {
          text1: this.data.buttons1Text,
          text2: this.data.buttons2Text,
          text3: this.data.buttons3Text,
          text4: this.data.buttons4Text,
          text5: this.data.buttons5Text,
          servicename:this.data.servicename

        })
      }

    })
  },

  button1(e) {
    this.setData({
      showbuttons1: false,
      buttons1Text: e.currentTarget.dataset.text,
      showitem2: true
    })
  },
  showbuttons1() {
    this.setData({
      showbuttons1: true
    })
  },

  button2(e) {
    this.setData({
      showitem3: true,
      showbuttons2: false,
      buttons2Text: e.currentTarget.dataset.text
    })
  },
  showbuttons2() {
    this.setData({
      showbuttons2: true
    })
  },


  button3(e) {
    this.setData({
      showitem4: true,
      showbuttons3: false,
      buttons3Text: e.currentTarget.dataset.text
    })
  },
  showbuttons3() {
    this.setData({
      showbuttons3: true
    })
  },


  button4(e) {
    this.setData({
      showitem5: true,
      showbuttons4: false,
      buttons4Text: e.currentTarget.dataset.text
    })
  },
  showbuttons4() {
    this.setData({
      showbuttons4: true
    })
  },



  button5(e) {
    this.setData({
      showbuttons5: false,
      buttons5Text: e.currentTarget.dataset.text,
      bottombutton: true
    })
  },
  showbuttons5() {
    this.setData({
      showbuttons5: true,

    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})